package com.inspur.edp.common.expr.expresses.compare;

/**
 * @author lizhaorui
 * @description TODO
 * @date 2024/12/12 10:20
 */
public enum CompareOperator {

    equal("equal"),
    notEqual("notEqual"),
    greaterThan("greaterThan"),
    greaterThanEqual("greaterThanEqual"),
    lessThan("lessThan"),
    lessThanEqual("lessThanEqual"),
    lengthGreaterThan("lengthGreaterThan"),
    lengthGreaterThanEqual("lengthGreaterThanEqual"),
    lengthLessThan("lengthLessThan"),
    lengthLessThanEqual("lengthLessThanEqual"),
    contain("contain"),
    notContain("notContain"),
    isEmpty("isEmpty"),
    notEmpty("notEmpty");

    private String operator;

    CompareOperator(String operator) {
        this.operator = operator;
    }

    @Override
    public String toString() {
        return this.operator;
    }

    public String getOperatorI18n() {
        switch (this) {
            case equal:
                return "等于";
            case notEqual:
                return "不等于";
            case greaterThan:
                return "大于";
            case greaterThanEqual:
                return "大于等于";
            case lessThan:
                return "小于";
            case lessThanEqual:
                return "小于等于";
            case lengthGreaterThan:
                return "长度大于";
            case lengthGreaterThanEqual:
                return "长度大于等于";
            case lengthLessThan:
                return "长度小于";
            case lengthLessThanEqual:
                return "长度小于等于";
            case contain:
                return "包含";
            case isEmpty:
                return "为空";
            case notEmpty:
                return "不为空";
            default:
                return "";
        }
    }

}
